package com.yict.common.service;

import java.io.Serializable;
import java.util.List;

public interface ICommonService<T, PK extends Serializable> {

	public boolean save(T t) throws Exception;

	public boolean update(T t) throws Exception;

	public boolean remove(T t) throws Exception;

	public boolean remove(List<T> t) throws Exception;
	
	public T findById(Long id);
	
	/**
	 * 根据单个属性查找
	 * @param value
	 * @param propertyName
	 * @return
	 */
	public List<T> listByProperty(Object value,String propertyName);
	
	/**
	 * 根据属性查找唯一记录
	 * @param value
	 * @param propertyName
	 * @return
	 * @throws Exception
	 */
	public T findByUnique(Object value,String propertyName);
}
